import Vue from 'vue'
import Vuex from 'vuex'
import persistence from 'vuex-uniapp-persistence'
import user from './user'
import address from './address'
Vue.use(Vuex)
const store = new Vuex.Store({
  // 使用模块
  plugins: [persistence()],
  state: {
    // uni.getWindowInfo() 同步获取到设备的信息，其中safeArea代表安全区域
    safeArea: uni.getWindowInfo().safeArea,
    // 胶囊的安全区域uni.getMenuButtonBoundingClientRect() 同步获取到设备的信息
    capsule: uni.getMenuButtonBoundingClientRect(),
    //获取当前平台信息uni.getSystemInfoSync()
    platform: uni.getSystemInfoSync().platform
  },
  getters: {},
  mutations: {},
  modules: {
    user,
    address
  }
})
export default store
